package net.flintx.array;

import java.util.Arrays;

/**
 * Created by flintx on 2018/1/10.
 */
public class ContainsDuplicate {
    public boolean containsDuplicate(int[] nums) {
        Arrays.sort(nums);
        for (int i = 1, len = nums.length; i < len; i++) {
            if (nums[i] == nums[i-1]) return true;
        }
        return false;
    }
}
